home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
BUSITION
/
SMARKET2.LZH
/
HLRB.EXE
/
DIR.INC
< prev
next >
Wrap
Text File
|
1991-08-08
|
2KB
|
100 lines
{===== Display Current Directory =====}
TYPE
Dir3 = STRING[3];
FCBArray = ARRAY[0..36] OF CHAR;
CONST
GetDta = $1a;
Get1stdir = $11;
Getnextdir = $12;
VAR
Dfcb : FCBArray;
Dta : FCBArray;
PROCEDURE DTAcall;
VAR
Regs : REGISTERS;
BEGIN
WITH Regs DO
BEGIN
ah := GetDta;
ds := SEG(Dta);
dx := OFS(Dta);
MSDOS(Regs)
END;
END;
PROCEDURE Dircall(Call: BYTE; VAR Errflag: BYTE);
VAR
Regs : REGISTERS;
BEGIN
WITH Regs DO
BEGIN
ah := Call;
cx := 0;
ds := SEG(Dfcb);
dx := OFS(Dfcb);
MSDOS(Regs);
Errflag:= al;
END;
END; {dircall}
PROCEDURE ShowFiles(LFExt : Dir3);
VAR
DIRFile : STRING[8];
Err : BYTE;
Exten : STRING[3];
SFOkay : BOOLEAN;
i : BYTE;
j : BYTE;
BEGIN
SFOkay := FALSE;
Dfcb[0]:= ^@;
FOR i:= 1 TO 11 DO Dfcb[i]:= '?';
DTACall;
Dircall(Get1stdir, Err);
j:= 0;
REPEAT
DIRFile:= '';
FOR i:= 1 TO 8 DO DIRFile:= DIRFile + Dta[i];
Exten := '';
FOR i:= 1 TO 3 DO Exten := Exten + Dta[i+8];
IF LENGTH(LFExt) = 0
THEN
BEGIN
SFOkay := TRUE;
j := j + 20;
GOTOXY(j-19, WHEREY);
WRITE(DIRFile+'.'+Exten);
IF j = 80 THEN
BEGIN
WRITELN;
j := 0;
END;
END
ELSE
BEGIN
IF Exten = LFExt THEN
BEGIN
SFOkay := TRUE;
j := j + 10;
GOTOXY(j-9, WHEREY);
WRITE(DIRFile);
IF j = 80 THEN
BEGIN
WRITELN;
j := 0;
END;
END;
END;
Dircall(Getnextdir, Err);
UNTIL Err <> 0;
IF NOT SFOkay THEN
BEGIN
WRITELN;
WRITELN('Nothing to list');
END;
WRITELN;
END;